import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'

// 添加请求拦截器
axios.interceptors.request.use(config => {
  const token = localStorage.getItem('token')
  if (token) {
    config.headers['Authorization'] = 'Bearer ' + token
  }
  return config
}, error => {
  return Promise.reject(error)
})

const app = createApp(App)
app.use(router)
app.mount('#app')
